import request from '@/axios'
import { NoticeParams, NoticeResponse } from './types'

export const getNoticeApi = (params: NoticeParams) => {
  return request.get<NoticeResponse>({ url: '/system/notice', params })
}

export const deleteNoticeByIdApi = (ids: string[] | number[]) => {
  return request.delete({ url: '/system/noticeDelete', data: { ids } })
}

export const saveNoticeApi = (data: any) => {
  return request[data.id ? 'put' : 'post']({
    url: data.id ? '/system/noticeEdit' : '/system/noticeAdd',
    data
  })
}
